package com.xiaozhengkeji.springcloud.ezcloud.common.core.bean;

import com.google.gson.Gson;
import lombok.Data;

/**
 * 封装Result 用于同一数据返回格式
 */
@Data
public class RetResult {
    private Integer code;
    private String msg;
    private String data;

    public RetResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        if (data != null) {
            this.data = new Gson().toJson(data);
        } else {
            this.data = null;
        }
    }


}
